package com.hc.model.code04.test7_1;

/**
 * @version v1.0
 * @ClassName: Client
 * @Description: 聊天工具测试
 * @Author: HC
 */
public class Client {

    public static void main(String[] args) {
        ChatMediator mediator = new ChatMediatorImpl();
        ConcreteUser user1 = new ConcreteUser("张三", mediator);
        ConcreteUser user2 = new ConcreteUser("李四", mediator);
        ConcreteUser user3 = new ConcreteUser("王五", mediator);

        mediator.addUser(user1);
        mediator.addUser(user2);
        mediator.addUser(user3);

        user1.sendMessage("张 hello");
        user2.sendMessage("李 hello");
        user3.sendMessage("王 hello");


    }
}
